const { Switch } = require("../lib/types");

module.exports = {
    name: "ngx_http_grpc_module",
    map: {
        grpc_bind: [[Switch, String], , ["http", "server", "location"]],
        grpc_buffer_size: [String, "4k|8k", ["http", "server", "location"]],
        grpc_connect_timeout: [String, "60s", ["http", "server", "location"]],
        grpc_hide_header: [String, , ["http", "server", "location"]],
        grpc_ignore_headers: [String, , ["http", "server", "location"]],
        grpc_intercept_errors: [Switch, false, ["http", "server", "location"]],
        grpc_next_upstream: [String, "error timeout", ["http", "server", "location"]],
        grpc_next_upstream_timeout: [String, "0", ["http", "server", "location"]],
        grpc_next_upstream_tries: [String, "0", ["http", "server", "location"]],
        grpc_pass: [String, , "location"],
        grpc_pass_header: [String, , ["http", "server", "location"]],
        grpc_read_timeout: [String, "60s", ["http", "server", "location"]],
        grpc_send_timeout: [String, "60s", ["http", "server", "location"]],
        grpc_set_header: [String, "Content-Length $content_length", ["http", "server", "location"]],
        grpc_socket_keepalive: [Switch, false, ["http", "server", "location"]],
        grpc_ssl_certificate: [String, , ["http", "server", "location"]],
        grpc_ssl_ciphers: [String, "DEFAULT", ["http", "server", "location"]],
        grpc_ssl_conf_command: [String, , ["http", "server", "location"]],
        grpc_ssl_crl: [String, , ["http", "server", "location"]],
        grpc_ssl_name: [String, "host from grpc_pass", ["http", "server", "location"]],
        grpc_ssl_password_file: [String, , ["http", "server", "location"]],
        grpc_ssl_protocols: [String, "TLSv1 TLSv1.1 TLSv1.2", ["http", "server", "location"]],
        grpc_ssl_server_name: [Switch, false, ["http", "server", "location"]],
        grpc_ssl_session_reuse: [Switch, true, ["http", "server", "location"]],
        grpc_ssl_trusted_certificate: [String, , ["http", "server", "location"]],
        grpc_ssl_verify: [Switch, false, ["http", "server", "location"]],
        grpc_ssl_verify_depth: [Number, 1, ["http", "server", "location"]]
    }
};